class Common {
	public constructor() {
	}

	private static _instance:Common;

	public static get Instance(){
		if(!this._instance){
			this._instance = new Common();
		}
		return this._instance;
	}

	/**
	 * 获取一张图片
	 */
	public createBitmapByName(name: string): egret.Bitmap {
        var result: egret.Bitmap = new egret.Bitmap();
        var texture: egret.Texture = RES.getRes(name);
        result.texture = texture;
        return result;
    }

	/**
	 * 世界坐标转p2坐标
	 */
	public worldToP2(x:number,y:number,w:number=0,h:number=0){
		return [(x+w*0.5)*GameData.factorc, (GameData.stageHeight - (y+h*0.5))*GameData.factorc]
	}

}